<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/ui/edit.jsp" %>
<body>
<div class="page-container">
    <div class="page-title">
        <div class="page-title-context">
            <button type="button" class="layui-btn layui-btn-primary" onclick="onSubmit()">保存</button>
        </div>
    </div>
    <div class="page-body">
        <div class="page-context">
            <div class="page-context-title">
                <span class="layui-breadcrumb">
                  <a href="/">首页</a>
                  <a><cite>用户管理</cite></a>
                </span>
            </div>
            <div class="page-context-container">
                <form class="layui-form" action="/sysOrgUser/save" method="post">
                    <table class="tb-table">
                        <tr>
                            <td class="tb-title" style="width: 15%">名称</td>
                            <td colspan="3">
                                <input type="text" name="fdName" placeholder="请输入名称" lay-verify="required"
                                       class="layui-input"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tb-title" style="width: 15%">用户名</td>
                            <td colspan="3">
                                <input type="text" name="fdUserName" placeholder="请输入用户名" lay-verify="required"
                                       class="layui-input"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tb-title" style="width: 15%">密码</td>
                            <td colspan="3">
                                <input type="text" name="fdPassWord" placeholder="请输入密码" lay-verify="required"
                                       class="layui-input"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tb-title" style="width: 15%">地址</td>
                            <td colspan="3">
                                <div id="fdAddressId"></div>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
    <div class="page-footer">
        <div class="page-footer-context">
        </div>
    </div>
</div>


<script>
    layui.config({
        base: '${LUI_ContextPath}/ui/layui/layui_exts/xm-select/'
    }).extend({
        xmSelect: 'xm-select'
    }).use(['xmSelect'], function () {
        var xmSelect = layui.xmSelect;
        var $ = layui.$;

        var node = xmSelect.render({
            el: '#fdAddressId',
            radio: true,
            filterable: true,
            remoteSearch: true,
            name: 'fdAddressId',
            layVerify: 'required',
            tips: '选择一个具体的地址?',
            prop: {
                name: 'fdName',
                value: 'fdId'
            },
            data: [
            ],
            remoteMethod: function (val, cb, show) {
                $.ajax({
                    method: 'POST',
                    url: '/sysOrgAddress/data',
                    data: {fdName: val},
                    success: function (data) {
                        if (data) {
                            return cb(data.content);
                        }
                        return cb([]);
                    }
                });
            }
        });
    })
</script>
<%@ include file="/ui/footer.jsp" %>

